package git.soulbgm.common.pojo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 贺瑞杰
 * @version V1.0
 * @date 2019-04-17 10:03
 * @description
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultData<T> {

    private Integer code;

    private String msg;

    private T data;

    public static <T> ResultData<T> getResultData(ReturnCode returnCode, T data) {
        ResultData resultData = new ResultData();
        resultData.code = returnCode.code;
        resultData.msg = returnCode.msg;
        resultData.data = data;
        return resultData;
    }
}
